WIP on main: 1f7579c Phase W + V' 완료: before→filled→after 파이프라인 + 조립 로직 수정

This commit is contained in:
kmlee1 committed 2026-04-06 07:23:35 +09:00
commit 26319f6bd9
13 files changed
+1036 -383

No files matched your search

+92
View File
@@ -369,6 +369,98 @@ LAYOUT_PRESETS = {
}
# ══════════════════════════════════════
# Phase X: 레이아웃 템플릿 (Kei가 선택)
# ══════════════════════════════════════
# 중간 영역의 컨테이너 구조 정의.
# 상단(header)과 하단(footer/결론)은 모든 템플릿 공통.
# zones의 각 영역:
# - width_pct: 슬라이드 내부 폭 대비 % (gap 제외 전)
# - row: 어느 행에 속하는지 ("top", "bottom", "full")
# - col_span: 해당 행에서 몇 칸 중 하나인지 (행 내 등분)
# 크기는 weight와 슬라이드 크기에서 동적 계산. budget_px 없음.
LAYOUT_TEMPLATES = {
"A": {
"name": "body-sidebar",
"description": "좌측 본문 흐름 + 우측 참조 사이드바",
"rows": [
{"name": "main", "zones": ["body", "sidebar"], "splits": [65, 35]},
],
"zones": {
"body": {"row": "main", "desc": "본문 꼭지 (위→아래 순서)"},
"sidebar": {"row": "main", "desc": "참조/보조 정보"},
},
},
"B": {
"name": "top-wide-bottom-2col",
"description": "상단 강조 + 하단 2분할",
"rows": [
{"name": "top", "zones": ["top"], "splits": [100]},
{"name": "bottom", "zones": ["bottom_left", "bottom_right"], "splits": [50, 50]},
],
"zones": {
"top": {"row": "top", "desc": "강조/핵심 콘텐츠 (전체 폭)"},
"bottom_left": {"row": "bottom", "desc": "하단 좌측 항목"},
"bottom_right": {"row": "bottom", "desc": "하단 우측 항목"},
},
},
"C": {
"name": "top-wide-bottom-3col",
"description": "상단 강조 + 하단 3분할",
"rows": [
{"name": "top", "zones": ["top"], "splits": [100]},
{"name": "bottom", "zones": ["bottom_1", "bottom_2", "bottom_3"], "splits": [33, 34, 33]},
],
"zones": {
"top": {"row": "top", "desc": "강조/핵심 콘텐츠 (전체 폭)"},
"bottom_1": {"row": "bottom", "desc": "하단 첫째 항목"},
"bottom_2": {"row": "bottom", "desc": "하단 둘째 항목"},
"bottom_3": {"row": "bottom", "desc": "하단 셋째 항목"},
},
},
"D": {
"name": "2col-equal",
"description": "좌우 대등 2분할",
"rows": [
{"name": "main", "zones": ["left", "right"], "splits": [50, 50]},
],
"zones": {
"left": {"row": "main", "desc": "좌측 항목"},
"right": {"row": "main", "desc": "우측 항목"},
},
},
"E": {
"name": "single-full",
"description": "단일 전체 (분할 불필요)",
"rows": [
{"name": "main", "zones": ["main"], "splits": [100]},
],
"zones": {
"main": {"row": "main", "desc": "본심 전체"},
},
},
"F": {
"name": "top-wide-bottom-2col-sidebar",
"description": "상단 강조 + 하단 2분할 + 우측 참조",
"rows": [
{"name": "top", "zones": ["top", "sidebar"], "splits": [65, 35]},
{"name": "bottom", "zones": ["bottom_left", "bottom_right", "sidebar"], "splits": [32, 33, 35]},
],
"zones": {
"top": {"row": "top", "desc": "강조/핵심 콘텐츠"},
"sidebar": {"row": "top+bottom", "desc": "참조/보조 정보 (세로 관통)"},
"bottom_left": {"row": "bottom", "desc": "하단 좌측 항목"},
"bottom_right": {"row": "bottom", "desc": "하단 우측 항목"},
},
},
}
def get_template(template_id: str) -> dict[str, Any] | None:
"""템플릿 ID(A~F)로 템플릿 정의를 반환한다."""
return LAYOUT_TEMPLATES.get(template_id)
# ──────────────────────────────────────
# Step A: 프리셋 선택 (규칙 기반)
# ──────────────────────────────────────