diff --git a/frontend/components/screen/panels/DetailSettingsPanel.tsx b/frontend/components/screen/panels/DetailSettingsPanel.tsx index 6a1c4d7f..81e1b2a9 100644 --- a/frontend/components/screen/panels/DetailSettingsPanel.tsx +++ b/frontend/components/screen/panels/DetailSettingsPanel.tsx @@ -883,10 +883,12 @@ export const DetailSettingsPanel: React.FC = ({ // 래퍼 컴포넌트: 새 ConfigPanel 인터페이스를 기존 패턴에 맞춤 const ConfigPanelWrapper = () => { - const config = currentConfig.config || definition.defaultConfig || {}; + // Section Card, Section Paper 등 신규 컴포넌트는 componentConfig 바로 아래에 설정 저장 + const config = currentConfig || definition.defaultProps?.componentConfig || {}; const handleConfigChange = (newConfig: any) => { - onUpdateProperty(selectedComponent.id, "componentConfig.config", newConfig); + // componentConfig 전체를 업데이트 + onUpdateProperty(selectedComponent.id, "componentConfig", newConfig); }; return ( @@ -895,7 +897,7 @@ export const DetailSettingsPanel: React.FC = ({

{definition.name} 설정

- + ); }; diff --git a/frontend/components/screen/panels/UnifiedPropertiesPanel.tsx b/frontend/components/screen/panels/UnifiedPropertiesPanel.tsx index f4942953..fce80d48 100644 --- a/frontend/components/screen/panels/UnifiedPropertiesPanel.tsx +++ b/frontend/components/screen/panels/UnifiedPropertiesPanel.tsx @@ -8,6 +8,7 @@ import { Badge } from "@/components/ui/badge"; import { Separator } from "@/components/ui/separator"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Checkbox } from "@/components/ui/checkbox"; +import { Textarea } from "@/components/ui/textarea"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; import { ChevronDown, Settings, Info, Database, Trash2, Copy, Palette, Monitor } from "lucide-react"; import { @@ -266,7 +267,12 @@ export const UnifiedPropertiesPanel: React.FC = ({ const renderComponentConfigPanel = () => { if (!selectedComponent) return null; - const componentType = selectedComponent.componentConfig?.type || selectedComponent.type; + // 🎯 Section Card, Section Paper 등 신규 컴포넌트는 componentType에서 감지 + const componentType = + selectedComponent.componentType || // ⭐ 1순위: ScreenDesigner가 설정한 componentType (section-card 등) + selectedComponent.componentConfig?.type || + selectedComponent.componentConfig?.id || + selectedComponent.type; const handleUpdateProperty = (path: string, value: any) => { onUpdateProperty(selectedComponent.id, path, value); @@ -276,10 +282,15 @@ export const UnifiedPropertiesPanel: React.FC = ({ onUpdateProperty(selectedComponent.id, "componentConfig.config", newConfig); }; - // 🆕 ComponentRegistry에서 ConfigPanel 가져오기 - const componentId = selectedComponent.componentConfig?.type || selectedComponent.componentConfig?.id; + // 🆕 ComponentRegistry에서 ConfigPanel 가져오기 시도 + const componentId = + selectedComponent.componentType || // ⭐ section-card 등 + selectedComponent.componentConfig?.type || + selectedComponent.componentConfig?.id; + if (componentId) { const definition = ComponentRegistry.getComponent(componentId); + if (definition?.configPanel) { const ConfigPanelComponent = definition.configPanel; const currentConfig = selectedComponent.componentConfig || {}; @@ -293,10 +304,12 @@ export const UnifiedPropertiesPanel: React.FC = ({ // 래퍼 컴포넌트: 새 ConfigPanel 인터페이스를 기존 패턴에 맞춤 const ConfigPanelWrapper = () => { - const config = currentConfig.config || definition.defaultConfig || {}; + // Section Card, Section Paper 등 신규 컴포넌트는 componentConfig 바로 아래에 설정 저장 + const config = currentConfig || definition.defaultProps?.componentConfig || {}; const handleConfigChange = (newConfig: any) => { - onUpdateProperty(selectedComponent.id, "componentConfig.config", newConfig); + // componentConfig 전체를 업데이트 + onUpdateProperty(selectedComponent.id, "componentConfig", newConfig); }; return ( @@ -305,18 +318,19 @@ export const UnifiedPropertiesPanel: React.FC = ({

{definition.name} 설정

- + ); }; return ; } else { - console.warn("⚠️ ConfigPanel 없음:", { + console.warn("⚠️ ComponentRegistry에서 ConfigPanel을 찾을 수 없음 - switch case로 이동:", { componentId, definitionName: definition?.name, hasDefinition: !!definition, }); + // ConfigPanel이 없으면 아래 switch case로 넘어감 } } @@ -363,6 +377,280 @@ export const UnifiedPropertiesPanel: React.FC = ({ case "badge-status": return ; + case "section-card": + return ( +
+
+

Section Card 설정

+

+ 제목과 테두리가 있는 명확한 그룹화 컨테이너 +

+
+ + {/* 헤더 표시 */} +
+ { + handleUpdateProperty(selectedComponent.id, "componentConfig.showHeader", checked); + }} + /> + +
+ + {/* 제목 */} + {selectedComponent.componentConfig?.showHeader !== false && ( +
+ + { + handleUpdateProperty(selectedComponent.id, "componentConfig.title", e.target.value); + }} + placeholder="섹션 제목 입력" + className="h-9 text-xs" + /> +
+ )} + + {/* 설명 */} + {selectedComponent.componentConfig?.showHeader !== false && ( +
+ +