2026-02-02 15:15:01 +09:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import { useState } from "react";
|
|
|
|
|
import { useDrag } from "react-dnd";
|
|
|
|
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { Input } from "@/components/ui/input";
|
|
|
|
|
import { Label } from "@/components/ui/label";
|
|
|
|
|
import {
|
|
|
|
|
Collapsible,
|
|
|
|
|
CollapsibleContent,
|
|
|
|
|
CollapsibleTrigger,
|
|
|
|
|
} from "@/components/ui/collapsible";
|
|
|
|
|
import {
|
|
|
|
|
Plus,
|
|
|
|
|
Settings,
|
|
|
|
|
Type,
|
|
|
|
|
MousePointer,
|
|
|
|
|
List,
|
|
|
|
|
Activity,
|
|
|
|
|
ScanLine,
|
|
|
|
|
Calculator,
|
|
|
|
|
Trash2,
|
|
|
|
|
ChevronDown,
|
|
|
|
|
GripVertical,
|
|
|
|
|
} from "lucide-react";
|
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
|
import {
|
2026-02-03 19:11:03 +09:00
|
|
|
PopLayoutDataV3,
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
PopLayoutModeKey,
|
2026-02-03 19:11:03 +09:00
|
|
|
PopComponentDefinition,
|
2026-02-02 15:15:01 +09:00
|
|
|
PopComponentType,
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
MODE_RESOLUTIONS,
|
2026-02-02 15:15:01 +09:00
|
|
|
} from "../types/pop-layout";
|
|
|
|
|
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
2026-02-02 15:15:01 +09:00
|
|
|
// 드래그 아이템 타입
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
2026-02-02 15:15:01 +09:00
|
|
|
export const DND_ITEM_TYPES = {
|
|
|
|
|
COMPONENT: "component",
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
export interface DragItemComponent {
|
|
|
|
|
type: typeof DND_ITEM_TYPES.COMPONENT;
|
|
|
|
|
componentType: PopComponentType;
|
|
|
|
|
}
|
|
|
|
|
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
2026-02-02 15:15:01 +09:00
|
|
|
// 컴포넌트 팔레트 정의
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
2026-02-02 15:15:01 +09:00
|
|
|
const COMPONENT_PALETTE: {
|
|
|
|
|
type: PopComponentType;
|
|
|
|
|
label: string;
|
|
|
|
|
icon: React.ElementType;
|
|
|
|
|
description: string;
|
|
|
|
|
}[] = [
|
|
|
|
|
{
|
|
|
|
|
type: "pop-field",
|
|
|
|
|
label: "필드",
|
|
|
|
|
icon: Type,
|
|
|
|
|
description: "텍스트, 숫자 등 데이터 입력",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "pop-button",
|
|
|
|
|
label: "버튼",
|
|
|
|
|
icon: MousePointer,
|
|
|
|
|
description: "저장, 삭제 등 액션 실행",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "pop-list",
|
|
|
|
|
label: "리스트",
|
|
|
|
|
icon: List,
|
2026-02-03 19:11:03 +09:00
|
|
|
description: "데이터 목록 (카드 템플릿 지원)",
|
2026-02-02 15:15:01 +09:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "pop-indicator",
|
|
|
|
|
label: "인디케이터",
|
|
|
|
|
icon: Activity,
|
|
|
|
|
description: "KPI, 상태 표시",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "pop-scanner",
|
|
|
|
|
label: "스캐너",
|
|
|
|
|
icon: ScanLine,
|
|
|
|
|
description: "바코드/QR 스캔",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "pop-numpad",
|
|
|
|
|
label: "숫자패드",
|
|
|
|
|
icon: Calculator,
|
|
|
|
|
description: "숫자 입력 전용",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
2026-02-03 19:11:03 +09:00
|
|
|
// Props (v3: 섹션 없음)
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
|
|
|
|
interface PopPanelProps {
|
2026-02-03 19:11:03 +09:00
|
|
|
layout: PopLayoutDataV3;
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
activeModeKey: PopLayoutModeKey;
|
2026-02-03 19:11:03 +09:00
|
|
|
selectedComponentId: string | null;
|
|
|
|
|
selectedComponent: PopComponentDefinition | null;
|
|
|
|
|
onUpdateComponentDefinition: (id: string, updates: Partial<PopComponentDefinition>) => void;
|
|
|
|
|
onDeleteComponent: (id: string) => void;
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
activeDevice: "mobile" | "tablet";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ========================================
|
|
|
|
|
// 메인 컴포넌트
|
|
|
|
|
// ========================================
|
2026-02-02 15:15:01 +09:00
|
|
|
export function PopPanel({
|
|
|
|
|
layout,
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
activeModeKey,
|
2026-02-03 19:11:03 +09:00
|
|
|
selectedComponentId,
|
|
|
|
|
selectedComponent,
|
|
|
|
|
onUpdateComponentDefinition,
|
|
|
|
|
onDeleteComponent,
|
2026-02-02 15:15:01 +09:00
|
|
|
activeDevice,
|
|
|
|
|
}: PopPanelProps) {
|
|
|
|
|
const [activeTab, setActiveTab] = useState<string>("components");
|
|
|
|
|
|
2026-02-03 19:11:03 +09:00
|
|
|
// 현재 모드의 컴포넌트 위치
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
const currentModeLayout = layout.layouts[activeModeKey];
|
2026-02-03 19:11:03 +09:00
|
|
|
const selectedComponentPosition = selectedComponentId
|
|
|
|
|
? currentModeLayout.componentPositions[selectedComponentId]
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
: null;
|
|
|
|
|
|
2026-02-02 15:15:01 +09:00
|
|
|
return (
|
|
|
|
|
<div className="flex h-full flex-col">
|
|
|
|
|
<Tabs
|
|
|
|
|
value={activeTab}
|
|
|
|
|
onValueChange={setActiveTab}
|
|
|
|
|
className="flex h-full flex-col"
|
|
|
|
|
>
|
|
|
|
|
<TabsList className="mx-2 mt-2 grid w-auto grid-cols-2">
|
|
|
|
|
<TabsTrigger value="components" className="text-xs">
|
|
|
|
|
<Plus className="mr-1 h-3.5 w-3.5" />
|
|
|
|
|
컴포넌트
|
|
|
|
|
</TabsTrigger>
|
|
|
|
|
<TabsTrigger value="edit" className="text-xs">
|
|
|
|
|
<Settings className="mr-1 h-3.5 w-3.5" />
|
|
|
|
|
편집
|
|
|
|
|
</TabsTrigger>
|
|
|
|
|
</TabsList>
|
|
|
|
|
|
|
|
|
|
{/* 컴포넌트 탭 */}
|
|
|
|
|
<TabsContent value="components" className="flex-1 overflow-auto p-2">
|
|
|
|
|
<div className="space-y-4">
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
{/* 현재 모드 표시 */}
|
|
|
|
|
<div className="rounded-lg bg-muted p-2">
|
|
|
|
|
<p className="text-xs font-medium text-muted-foreground">
|
|
|
|
|
편집 중: {getModeLabel(activeModeKey)}
|
|
|
|
|
</p>
|
|
|
|
|
<p className="text-[10px] text-muted-foreground">
|
|
|
|
|
{MODE_RESOLUTIONS[activeModeKey].width} x {MODE_RESOLUTIONS[activeModeKey].height}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-02 15:15:01 +09:00
|
|
|
{/* 컴포넌트 팔레트 */}
|
|
|
|
|
<div>
|
|
|
|
|
<h4 className="mb-2 text-xs font-medium text-muted-foreground">
|
|
|
|
|
컴포넌트
|
|
|
|
|
</h4>
|
|
|
|
|
<div className="space-y-1">
|
|
|
|
|
{COMPONENT_PALETTE.map((item) => (
|
|
|
|
|
<DraggableComponentItem
|
|
|
|
|
key={item.type}
|
|
|
|
|
type={item.type}
|
|
|
|
|
label={item.label}
|
|
|
|
|
icon={item.icon}
|
|
|
|
|
description={item.description}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
<p className="mt-2 text-xs text-muted-foreground">
|
2026-02-03 19:11:03 +09:00
|
|
|
캔버스로 드래그하여 배치
|
2026-02-02 15:15:01 +09:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</TabsContent>
|
|
|
|
|
|
|
|
|
|
{/* 편집 탭 */}
|
|
|
|
|
<TabsContent value="edit" className="flex-1 overflow-auto p-2">
|
2026-02-03 19:11:03 +09:00
|
|
|
{selectedComponent && selectedComponentPosition ? (
|
|
|
|
|
<ComponentEditorV3
|
|
|
|
|
component={selectedComponent}
|
|
|
|
|
position={selectedComponentPosition}
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
activeModeKey={activeModeKey}
|
|
|
|
|
onUpdateDefinition={(updates) =>
|
2026-02-03 19:11:03 +09:00
|
|
|
onUpdateComponentDefinition(selectedComponent.id, updates)
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
}
|
2026-02-03 19:11:03 +09:00
|
|
|
onDelete={() => onDeleteComponent(selectedComponent.id)}
|
2026-02-02 15:15:01 +09:00
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="flex h-40 items-center justify-center text-sm text-muted-foreground">
|
2026-02-03 19:11:03 +09:00
|
|
|
컴포넌트를 선택하세요
|
2026-02-02 15:15:01 +09:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</TabsContent>
|
|
|
|
|
</Tabs>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
|
|
|
|
// 모드 라벨 헬퍼
|
|
|
|
|
// ========================================
|
|
|
|
|
function getModeLabel(modeKey: PopLayoutModeKey): string {
|
|
|
|
|
const labels: Record<PopLayoutModeKey, string> = {
|
|
|
|
|
tablet_landscape: "태블릿 가로",
|
|
|
|
|
tablet_portrait: "태블릿 세로",
|
|
|
|
|
mobile_landscape: "모바일 가로",
|
|
|
|
|
mobile_portrait: "모바일 세로",
|
|
|
|
|
};
|
|
|
|
|
return labels[modeKey];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ========================================
|
2026-02-02 15:15:01 +09:00
|
|
|
// 드래그 가능한 컴포넌트 아이템
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
2026-02-02 15:15:01 +09:00
|
|
|
interface DraggableComponentItemProps {
|
|
|
|
|
type: PopComponentType;
|
|
|
|
|
label: string;
|
|
|
|
|
icon: React.ElementType;
|
|
|
|
|
description: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function DraggableComponentItem({
|
|
|
|
|
type,
|
|
|
|
|
label,
|
|
|
|
|
icon: Icon,
|
|
|
|
|
description,
|
|
|
|
|
}: DraggableComponentItemProps) {
|
|
|
|
|
const [{ isDragging }, drag] = useDrag(() => ({
|
|
|
|
|
type: DND_ITEM_TYPES.COMPONENT,
|
|
|
|
|
item: { type: DND_ITEM_TYPES.COMPONENT, componentType: type } as DragItemComponent,
|
|
|
|
|
collect: (monitor) => ({
|
|
|
|
|
isDragging: monitor.isDragging(),
|
|
|
|
|
}),
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
ref={drag}
|
|
|
|
|
className={cn(
|
|
|
|
|
"flex cursor-grab items-start gap-3 rounded-lg border p-3 transition-all",
|
|
|
|
|
"hover:bg-accent hover:text-accent-foreground",
|
|
|
|
|
isDragging && "opacity-50 ring-2 ring-primary"
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<GripVertical className="mt-0.5 h-4 w-4 text-gray-400" />
|
|
|
|
|
<Icon className="mt-0.5 h-4 w-4 shrink-0" />
|
|
|
|
|
<div className="flex-1 space-y-1">
|
|
|
|
|
<p className="text-sm font-medium leading-none">{label}</p>
|
|
|
|
|
<p className="text-xs text-muted-foreground">{description}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
2026-02-03 19:11:03 +09:00
|
|
|
// v3 컴포넌트 편집기
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
// ========================================
|
2026-02-03 19:11:03 +09:00
|
|
|
interface ComponentEditorV3Props {
|
|
|
|
|
component: PopComponentDefinition;
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
position: { col: number; row: number; colSpan: number; rowSpan: number };
|
|
|
|
|
activeModeKey: PopLayoutModeKey;
|
2026-02-03 19:11:03 +09:00
|
|
|
onUpdateDefinition: (updates: Partial<PopComponentDefinition>) => void;
|
2026-02-02 15:15:01 +09:00
|
|
|
onDelete: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-03 19:11:03 +09:00
|
|
|
function ComponentEditorV3({
|
|
|
|
|
component,
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
position,
|
|
|
|
|
activeModeKey,
|
|
|
|
|
onUpdateDefinition,
|
2026-02-02 15:15:01 +09:00
|
|
|
onDelete,
|
2026-02-03 19:11:03 +09:00
|
|
|
}: ComponentEditorV3Props) {
|
|
|
|
|
const [isPositionOpen, setIsPositionOpen] = useState(true);
|
|
|
|
|
|
|
|
|
|
// 컴포넌트 타입 라벨
|
|
|
|
|
const typeLabels: Record<PopComponentType, string> = {
|
|
|
|
|
"pop-field": "필드",
|
|
|
|
|
"pop-button": "버튼",
|
|
|
|
|
"pop-list": "리스트",
|
|
|
|
|
"pop-indicator": "인디케이터",
|
|
|
|
|
"pop-scanner": "스캐너",
|
|
|
|
|
"pop-numpad": "숫자패드",
|
|
|
|
|
};
|
2026-02-02 15:15:01 +09:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-4">
|
2026-02-03 19:11:03 +09:00
|
|
|
{/* 컴포넌트 기본 정보 */}
|
2026-02-02 15:15:01 +09:00
|
|
|
<div className="flex items-center justify-between">
|
2026-02-03 19:11:03 +09:00
|
|
|
<div>
|
|
|
|
|
<span className="text-sm font-medium">{typeLabels[component.type]}</span>
|
|
|
|
|
<p className="text-[10px] text-muted-foreground">{component.id}</p>
|
|
|
|
|
</div>
|
2026-02-02 15:15:01 +09:00
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="icon"
|
|
|
|
|
className="h-7 w-7 text-destructive hover:bg-destructive/10"
|
|
|
|
|
onClick={onDelete}
|
|
|
|
|
>
|
|
|
|
|
<Trash2 className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* 라벨 */}
|
|
|
|
|
<div className="space-y-2">
|
2026-02-03 19:11:03 +09:00
|
|
|
<Label className="text-xs">라벨</Label>
|
2026-02-02 15:15:01 +09:00
|
|
|
<Input
|
2026-02-03 19:11:03 +09:00
|
|
|
value={component.label || ""}
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
onChange={(e) => onUpdateDefinition({ label: e.target.value })}
|
2026-02-03 19:11:03 +09:00
|
|
|
placeholder="컴포넌트 이름"
|
2026-02-02 15:15:01 +09:00
|
|
|
className="h-8 text-xs"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-03 19:11:03 +09:00
|
|
|
{/* 현재 모드 위치 (읽기 전용) */}
|
|
|
|
|
<Collapsible open={isPositionOpen} onOpenChange={setIsPositionOpen}>
|
2026-02-02 15:15:01 +09:00
|
|
|
<CollapsibleTrigger className="flex w-full items-center justify-between py-2 text-sm font-medium">
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
현재 모드 위치
|
2026-02-02 15:15:01 +09:00
|
|
|
<ChevronDown
|
|
|
|
|
className={cn(
|
|
|
|
|
"h-4 w-4 transition-transform",
|
2026-02-03 19:11:03 +09:00
|
|
|
isPositionOpen && "rotate-180"
|
2026-02-02 15:15:01 +09:00
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
</CollapsibleTrigger>
|
|
|
|
|
<CollapsibleContent className="space-y-3 pt-2">
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
<div className="rounded-lg bg-muted p-3">
|
|
|
|
|
<p className="mb-2 text-xs font-medium">{getModeLabel(activeModeKey)}</p>
|
|
|
|
|
<div className="grid grid-cols-2 gap-2 text-xs">
|
|
|
|
|
<div className="flex justify-between">
|
|
|
|
|
<span className="text-muted-foreground">시작 열:</span>
|
|
|
|
|
<span className="font-medium">{position.col}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex justify-between">
|
|
|
|
|
<span className="text-muted-foreground">시작 행:</span>
|
|
|
|
|
<span className="font-medium">{position.row}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex justify-between">
|
|
|
|
|
<span className="text-muted-foreground">열 크기:</span>
|
|
|
|
|
<span className="font-medium">{position.colSpan}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex justify-between">
|
|
|
|
|
<span className="text-muted-foreground">행 크기:</span>
|
|
|
|
|
<span className="font-medium">{position.rowSpan}</span>
|
|
|
|
|
</div>
|
2026-02-02 15:15:01 +09:00
|
|
|
</div>
|
|
|
|
|
</div>
|
feat(pop-designer): POP 디자이너 v2.0 - 4가지 디바이스 모드 및 캔버스 UX 개선
- v2 레이아웃 데이터 구조 도입 (4모드별 별도 레이아웃 + 공유 컴포넌트 정의)
- tablet_landscape, tablet_portrait, mobile_landscape, mobile_portrait
- sections/components를 Record<string, Definition> 객체로 관리
- v1 → v2 자동 마이그레이션 지원
- 캔버스 UX 개선
- 줌 기능 (30%~150%, 마우스 휠 + 버튼)
- 패닝 기능 (중앙 마우스, Space+드래그, 배경 드래그)
- 2개 캔버스 동시 표시 (가로/세로 모드)
- Delete 키로 섹션/컴포넌트 삭제 기능 추가
- layout.sections 순회하여 componentIds에서 부모 섹션 찾는 방식
- 미리보기 v2 레이아웃 호환성 수정
- Object.keys(layout.sections).length 체크로 변경
수정 파일: PopDesigner.tsx, PopCanvas.tsx, SectionGridV2.tsx(신규),
types/pop-layout.ts, PopPanel.tsx, PopScreenPreview.tsx,
PopCategoryTree.tsx, screenManagementService.ts
2026-02-03 11:25:00 +09:00
|
|
|
<p className="text-[10px] text-muted-foreground">
|
|
|
|
|
위치/크기는 캔버스에서 드래그하여 조정하세요.
|
|
|
|
|
각 모드(가로/세로)별로 별도 저장됩니다.
|
2026-02-02 15:15:01 +09:00
|
|
|
</p>
|
|
|
|
|
</CollapsibleContent>
|
|
|
|
|
</Collapsible>
|
|
|
|
|
|
2026-02-03 19:11:03 +09:00
|
|
|
{/* TODO: 컴포넌트별 설정 (config) */}
|
|
|
|
|
<div className="rounded-lg border border-dashed p-3">
|
|
|
|
|
<p className="text-xs text-muted-foreground text-center">
|
|
|
|
|
컴포넌트별 상세 설정은 추후 추가 예정
|
2026-02-02 15:15:01 +09:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|